package com.xc.stock.domain.basic.repository;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.rp.spring.jpa.GenericJpaRepository;
import com.xc.stock.domain.basic.convert.IEntityPOConvert;
import com.xc.stock.domain.basic.convert.TradeAccConvert;
import com.xc.stock.domain.basic.entity.TradeAcc;
import com.xc.stock.infrastructure.db.po.TradeAccPO;
import com.xc.stock.infrastructure.db.repo.TradeAccRepo;
import com.xc.stock.utils.SpringUtils;

import lombok.RequiredArgsConstructor;

/**
 * TradeAccRepository 
 *
 * @author rplees 
 * @email rplees.i.ly@gmail.com 
 * @created 2022/08/12 
 */
@Repository
@RequiredArgsConstructor(
    onConstructor = @__(@Autowired)
)
public class TradeAccRepository extends SimplePoConvertEntityRepository<TradeAcc, TradeAccPO, Integer> {
  final TradeAccRepo repo;

  final TradeAccConvert convert;

  @Override
  public GenericJpaRepository<TradeAccPO, Integer> repo() {
    return repo;
  }

  @Override
  public IEntityPOConvert<TradeAcc, TradeAccPO> convert() {
    return convert;
  }

  public static TradeAccRepository of() {
    return SpringUtils.getBean(TradeAccRepository.class);
  }
}
